// /////////////////////////////////////////////////////////////////////////////
//
// Name:            MainFrame.h
// Author:          Michael Bartsch
//
// Desc :           The interface for the CMainFrame class.
//
// License:         Copyright (C) 2008-2009 Michael Bartsch
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the GNU General Public
//                  License as published by the Free Software Foundation,
//                  either version 3 of the License, or (at your option) any
//                  later version.
//
//                  This program is distributed in the hope that it will be
//                  useful, but WITHOUT ANY WARRANTY; without even the implied
//                  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//                  PURPOSE. See the GNU General Public License for more
//                  details.
//
//                  You should have received a copy of the GNU General Public
//                  License along with this program. If not, see
//                  <http://www.gnu.org/licenses/>.
//
// /////////////////////////////////////////////////////////////////////////////

#ifndef __C_MAINFRAME_H_INCLUDED__
#define __C_MAINFRAME_H_INCLUDED__

// Include required header file(s).
#include "../App.h"

#include "./AIFrame/AIFrame.h"
#include "./ColourFrame/ColourFrame.h"
#include "./LuaFrame.h"
#include "./CameraPanel.h"
#include "./SettingsFrame.h"
#include "./AboutFrame.h"

#include "../../Engine/Communicator.h"


// Forward Declarations.
class CColourFrame;
class CColourAnalyser;
class CCommunicator;
class CLuaFrame;
class CAIFrame;
class CCameraPanel;
class CSettingsFrame;
class CAboutFrame;

// Enumerations.
//! Widget ID's
enum MF_WidgetIDs
{
    MF_CameraTimer = 1000,
    MF_LuaTerminal = 100,
    MF_ColourAnalyser,
    MF_AIControl,
    MF_Settings
};


// The CMainFrame class.
//! Class that contains all data and behaviour of the Main Frame.
class CMainFrame : public wxFrame
{
public:

    //! Constructor
    CMainFrame();

    // Event functions.
    //! Handles the close event.
    void onClose(wxCloseEvent &event);

    //! Event function for updating all time based behaviour.
    void onTimer(wxTimerEvent &event);

    //! Handles the "Quit" event of the "File" menu.
    void onQuit(wxCommandEvent &event);

    //! Event function for launching the Lua Frame.
    //! @see CLuaFrame
    void onLuaTerminal(wxCommandEvent &event);
    //! Event function for launching the Colour Frame.
    //! @see CColourFrame
    void onColourAnalyser(wxCommandEvent &event);
    //! Event function for launching the AI Frame.
    //! @see CAIFrame
    void onAIControl(wxCommandEvent &event);
    //! Event function for launching the Settings Frame.
    //! @see CSettingsFrame
    void onSettings(wxCommandEvent &event);

    //! Event function for launching the About Frame.
    //! @see CAboutFrame
    void onAbout(wxCommandEvent &event);

    // Set functions.
    //! Appends a new log message to the log control.
    void setLogMessage(const char *message);

    //! Resets the pointer to the Lua Frame to NULL.
    void resetLuaFrame();
    //! Resets the pointer to the Colour Frame to NULL.
    void resetColourFrame();
    //! Resets the pointer to the AI Frame to NULL.
    void resetAIFrame();


private:

    // Internal
    CColourAnalyser *pColourAnalyser;
    CCommunicator *pCommunicator;
	CAICore *pAICore;

    // wxWidgets
    CLuaFrame *luaFrame;
    CColourFrame *colourFrame;
    CAIFrame *aiFrame;

    CCameraPanel *cameraPanel;
    wxTextCtrl *logPane;

    wxAuiManager frameManager;

    wxTimer *camTimer;

    DECLARE_EVENT_TABLE()
};

#endif
